﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using Microsoft.Practices.ServiceLocation;

namespace MvcCms.Store.Web
{
    public class Routes : AreaRegistration
    {
        public override string AreaName
        {
            get { return "MvcCmsStore"; }
        }
        public override void RegisterArea(AreaRegistrationContext context)
        {
            var routes = context.Routes;
            
            //this is needed for now as the redirect from the login works off this
            routes.MapRoute(
                "thestorename",
                "thestorename" + "/{controller}/{action}/{Id}/",
                new { controller = "StoreHome", action = "Index", Id = 0 }
                ).DataTokens = new RouteValueDictionary(new { area = AreaName });
            

            //maybe make one for each portal at some point so wpo admin can use it we will see maybe
            routes.MapRoute(
                "MvcCms.StoreAjax",
                "MvcCmsStoreAjax/{controller}/{action}/{Id}/",
                new { controller = "StoreHome", action = "Index", Id = 0 }
                ).DataTokens = new RouteValueDictionary(new { area = AreaName });

        }
    }
}
